import gtk
import os
iconTheme = gtk.IconTheme()
iconTheme.set_search_path([os.getcwd()+"img/icons"])

def return_folder_mime():
    type = "folder"
    return type

def return_mime(file):
    ext = os.path.splitext(file)[1]
    if ext == ".txt": 
        type = "text-x-generic"
    elif ext == ".sh" or ext == ".py" or ext == ".pyc" or ext == ".php":
        type = "text-x-script"
    elif ext == ".html":
        type = "text-html"
    elif ext == ".zip" or ext == ".rar" or ext == ".bz2" or ext == ".gz":
        type = "package-x-generic"
    elif ext == ".doc" or ext == ".odt" or ext == ".pdf":
        type = "x-office-document"
    elif ext == ".png" or ext == ".jpg":
        type = "image-x-generic"
    elif ext == ".mp3" or ext == ".ogg":
        type = "audio-x-generic"
    elif ext == ".wmv" or ext == ".mpg" or ext == ".avi" or ext == ".mov":
        type = "video-x-generic"
    elif ext == ".exe" or ext == ".msi" or ext == ".bin":
        type = "application-x-executable"
    else: 
        type ="text-x-generic"
    
    return type